package com.d3.pomodoro.model

import com.baozi.treerecyclerview.annotation.TreeDataType
import com.d3.pomodoro.component.item.ChildItemFirst
import com.d3.pomodoro.component.item.ChildItemSecond
import com.d3.pomodoro.component.item.FatherItem

class ViewModel {

    @TreeDataType(iClass = FatherItem::class, bindField = "type")
    class TaskGroupItem {
        var itemName: String = ""
        var potatos: ArrayList<PotatoItem>? = null

        @TreeDataType(iClass = ChildItemFirst::class)
        class PotatoItem {
            var potato: Potato? = null
            var subPotatos: ArrayList<SubPotatoItem>? = null
            var itemName: String? = ""
                get() {
                    return potato?.title
                }

            @TreeDataType(iClass = ChildItemSecond::class)
            class SubPotatoItem {
                var subPotato: PotatoSub? = null
                var itemName: String? = ""
                    get() {
                        return subPotato?.title
                    }
            }
        }
    }

}
